<template>
  <div class="recommend">
    <router-link
      tag="div"
      :to="'/detail/'+item.id"
      class="item"
      v-for="(item,index) of recommendList"
      :key="index"
    >
      <img :src="item.imgUrl" alt>
      <div class="info">
        <h6>{{item.title}}</h6>
        <span>{{item.content}}</span>
        <button>查看详情</button>
      </div>
    </router-link>
  </div>
</template>

<script>
export default {
  name: "Recommend",
  props: {
    recommendList: {
      type: Array
    }
  }
};
</script>

<style lang="scss" scoped>
.item {
  border-bottom: 1px solid #ddd;
  display: flex;
  padding: 20px;
  img {
    width: 150px;
    height: 150px;
  }
  .info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    line-height: 40px;
    span {
      color: gray;
      font-size: 20px;
    }
    button {
      width: 60%;
      border: 1px solid #ddd;
      border-radius: 10px;
      padding: 5px;
      color: orange;
      font-size: 18px;
      background: #fff;
    }
  }
}
</style>
